<template>
  <div id="ExchangeCodeReviewList">
    <div class="header">
      <h4>兑换码审核</h4>
      <el-button type="primary">已审核列表</el-button>
    </div>
    <!-- 表单 -->
    <el-form ref="form" :model="sizeForm" :inline="true">
      <el-form-item label="申请时间:">
        <el-date-picker
          type="date"
          placeholder="选择日期"
          v-model="sizeForm.date1"
          style="width: 130px"
        ></el-date-picker>
        <span>到</span>
        <el-date-picker
          type="date"
          placeholder="选择日期"
          v-model="sizeForm.date2"
          style="width: 130px"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="审核时间:">
        <el-date-picker
          type="date"
          placeholder="选择日期"
          v-model="sizeForm.date1"
          style="width: 130px"
        ></el-date-picker>
        <span>到</span>
        <el-date-picker
          type="date"
          placeholder="选择日期"
          v-model="sizeForm.date2"
          style="width: 130px"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="状态:">
        <el-select v-model="sizeForm.region" style="width: 90px">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="已审核" value="shanghai"></el-option>
          <el-option label="待审核" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="手机号:">
        <el-input v-model="sizeForm.name" style="width: 100px"></el-input>
      </el-form-item>
      <el-form-item label="兑换码:">
        <el-input v-model="sizeForm.name" style="width: 100px"></el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="info" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
    <!-- 列表 -->
    <el-table
    :data="tableData"
    tooltip-effect="dark"
    style="width: 100%">
    <el-table-column
      label="申请时间">
      <template slot-scope="scope">{{ scope.row.date }}</template>
    </el-table-column>
    <el-table-column
      label="审核时间">
      <template slot-scope="scope">{{ scope.row.date }}</template>
    </el-table-column>
    <el-table-column
      prop="address"
      label="手机号"
      show-overflow-tooltip>
    </el-table-column>
    <el-table-column
      prop="address"
      label="兑换码"
      show-overflow-tooltip>
    </el-table-column>
    <el-table-column
      label="操作">
      <el-link type="success" style="margin-right: 10px;" @click="centerDialogVisible = true">审核通过</el-link>
      <el-link type="danger">拒绝</el-link>
    </el-table-column>
    <el-table-column
      prop="name"
      label="审核结果">
    </el-table-column>
    <el-table-column
      prop="date"
      label="卡券类型">
    </el-table-column>
  </el-table>
  <!-- 分页 -->
  <el-pagination 
    style="float:right"
      @current-change="handleCurrentChange"
      :current-page.sync="page"
      :page-size="limit"
      layout="prev, pager, next"
      :total="total"
    >
    </el-pagination>
    <el-dialog
  title="选择发放给用户的卡券类型"
  :visible.sync="centerDialogVisible"
  width="30%"
  center>
  <el-select placeholder="选择发放给用户的卡券类型" style="width:100%">
      <el-option label="单人区一小时卡" value="shanghai"></el-option>
      <el-option label="双人区早读卡" value="beijing"></el-option>
    </el-select>
  <span slot="footer" class="dialog-footer">
    <el-button @click="centerDialogVisible = false">取消</el-button>
    <el-button type="primary" @click="centerDialogVisible = false">确认发放</el-button>
  </span>
</el-dialog>
  </div>
</template>

<script>
export default {
  data: function () {
    return {
        page: 1,
      limit: 5,
      total: 50,
      sizeForm: {
        name: "",
        region: "全部",
        date1: "",
        date2: "",
    },
    tableData: [{
      date: '2016-05-03',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-02',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-04',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-01',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-08',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-06',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }, {
      date: '2016-05-07',
      name: '王小虎',
      address: '上海市普陀区金沙江路 1518 弄'
    }],
    centerDialogVisible: false,
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      handleCurrentChange: function () {},
  },
};
</script>

<style lang="less" scoped>
// #ExchangeCodeReviewList{
//     min-width: 1400px;
//       overflow: scroll;
// }
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  & > .el-button {
    width: 96px;
    height: 34px;
    font-size: 13px;
    line-height: 34px;
    padding: 0;
  }
}
.el-form {
  width: 100%;
  height: 40px;
  background: #d7d7d7;
  padding: 8px 0 8px 20px;
  margin-bottom: 10px;
}
</style>
